$(document).ready(function () {

    initTable();

})


function initTable() {

    $.ajax({
        url:'http://test.org/employee/list',
        method:'get',
        dataType:'json',
        success:function (data) {
            $('#list').bootstrapTable({
                data:data,
                columns:columns,
                classes:"table table-bordered table-striped",
                singleSelect:true,
                clickToSelect:true,
                pagination:true,
                toolbar:'#toolbar'
            })
        }
    })


}

var columns=[
    {
        checkbox:true
    },
    {
        field:'name',
        title:'员工姓名'
    },
    {
        field:'age',
        title:'员工年龄'
    },
    {
        field:'gender',
        title:'员工性别'
    }
]